package controllers;

import models.LocationTO;
import models.NumberTO;
import play.mvc.Controller;
import business.LocationBusiness;
import business.MathBusiness;

public class NumberApplication extends Application {

    public static void calcularFatorial(Integer numero){
    	System.out.println("calcularFatorial/"+numero);
    	NumberTO number = new NumberTO();
    	number.number = MathBusiness.calcularFatorial(numero);
    	number.code = CODE_OK_STATUS;
    	number.description = DESCRIPTION_OK_STATUS;
    	renderJSON(number);
    }
    
    public static void isPrimo(Integer numero){
    	System.out.println("isPrimo/"+numero);
    	NumberTO number = new NumberTO();
    	number.number = numero;
    	number.isPrimo=MathBusiness.isPrimo(numero);
    	System.out.println(number.isPrimo);
    	number.code = CODE_OK_STATUS;
    	number.description = DESCRIPTION_OK_STATUS;
    	renderJSON(number);
    }
}